package com.ruoyi.flowable.domain.dto;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author Tony
 * @date 2021/3/31 23:20
 */
@Data
public class FlowFormFieldDto implements Serializable {

    /**
     * 表单组件信息
     */
    private List<WidgetList> widgetList;

//    /**
//     * 表单全局配置
//     */
//    private FormConfig formConfig;


    /**
     * FormConfig
     */
    @Data
    public static class FormConfig implements Serializable {
        private String modelName;
        private String refName;
        private String rulesName;
        private long labelWidth;
        private String labelPosition;
        private String size;
        private String labelAlign;
        private String cssCode;
        private List<Object> customClass;
        private String functions;
        private String layoutType;
        private long jsonVersion;
        private String onFormCreated;
        private String onFormMounted;
        private String onFormDataChange;
        private String onFormValidate;
        private List<DataSource> dataSources;
    }

    /**
     * DataSource
     */
    @Data
    public static class DataSource implements Serializable {
        private String dataSourceId;
        private String uniqueName;
        private String requestURL;
        private String requestURLType;
        private String description;
        private List<Object> headers;
        private List<Object> params;
        private List<Object> data;
        private String requestMethod;
        private String configHandlerCode;
        private String dataHandlerCode;
        private String errorHandlerCode;
        private boolean dataSetEnabled;
        private List<Object> dataSets;
    }

    /**
     * WidgetList
     */
    @Data
    public static class WidgetList implements Serializable {
        private String type;
        private String icon;
        private boolean formItemFlag;
        private Options options;
        private String id;
        private Long key;
    }

    /**
     * Options
     */
    @Data
    public static class Options implements Serializable {
        private String name;
//        private String label;
//        private String labelAlign;
//        private String defaultValue;
//        private String columnWidth;
//        private String size;
//        private String displayStyle;
//        private Boolean buttonStyle;
//        private Boolean border;
//        private Object labelWidth;
//        private boolean labelHidden;
//        private boolean disabled;
//        private boolean hidden;
//        private List<OptionItem> optionItems;
//        private boolean required;
//        private String requiredHint;
//        private String validation;
//        private String validationHint;
//        private CustomClass customClass;
//        private String labelIconClass;
//        private String labelIconPosition;
//        private String labelTooltip;
//        private String onCreated;
//        private String onMounted;
//        private String onChange;
//        private String onValidate;
//        private String type;
//        private String startPlaceholder;
//        private String endPlaceholder;
//        private Boolean autoFullWidth;
//        private Boolean readonly;
//        private Boolean clearable;
//        private Boolean editable;
//        private String format;
//        private String valueFormat;
//        private String onFocus;
//        private String onBlur;
//        private String placeholder;
//        private Boolean showPassword;
//        private Object minLength;
//        private Object maxLength;
//        private Boolean showWordLimit;
//        private String prefixIcon;
//        private String suffixIcon;
//        private Boolean appendButton;
//        private Boolean appendButtonDisabled;
//        private String buttonIcon;
//        private String onInput;
//        private String onAppendButtonClick;
//        private String appendText;
//        private Long rows;
    }

    /**
     * CustomClass
     */
    @Data
    public static class CustomClass implements Serializable {
        public List<String> stringArrayValue;
        public String stringValue;
    }

    /**
     * OptionItem
     */
    @Data
    public static class OptionItem implements Serializable {
        private Value value;
        private String label;
    }

    /**
     * Value
     */
    @Data
    public static class Value implements Serializable {
        public Long integerValue;
        public String stringValue;
    }
}
